<html>
<Head>
<Title> Password 2 </Title>
</Head>
<Body> 
<script type = "text/javascript">
	var money = prompt("Enter your amount of money");
	money = parseInt(money);
if(money < 20000 && money > 190000){
	document.write("Error!! Need an amount bewteen 20000 and 190000 " );
		while(money < 20000 || money > 190000){
			alert("Error!");
				money = prompt("Enter another amount");
	}
	}
	var theHighCar = new Array("Bentley", "Mercedes Benz","BMW");
	var theSecHighCar = new Array("Mercedes Benz", "BMW","Camaro");
	var theSecLowCar = new Array("BMW","Camaro", "Mustang");
	var theLowCar = new Array("Camaro", "Mustang");
	
	var theHighOutside = new Array("cream", "white", "red");
	var theSecHighOutside = new Array("cream","white", "red");
	var theSecLowOutside = new Array("green", "white", "red", "blue");
	var theLowOutside = new Array( "green","red", "blue");
	
	var theHighYear = new Array("13", "12");
	var theSecHighYear = new Array( "12", "11","10");
	var theSecLowYear = new Array("11", "10", "09");
	var theLowYear = new Array( "10", "09");
	
	
	var theHighInside = new Array("cream","white");
	var theSecHighInside = new Array("cream", "black","white");
	var theSecLowInside = new Array( "black","white","burgundy");
	var theLowInside = new Array( "black","burgundy");
	
	
	document.write("You can get a ");
	document.write("</br>");
if( money >180000 && money < 190000){
	var theHighCrand = theHighCar[Math.floor(Math.random()*theHighCar.length)]
	document.write("Car: " + theHighCrand);
	if(theHighCrand == "Bentley"){
		var theBModel = new Array("Muslanne", "GT Speed", "GT V8");
		var theHighBModel = theBModel[Math.floor(Math.random()*theBModel.length)]
		document.write("</br>");
		document.write("Model of the Bentley is a: " + theHighBModel);
		}
	if(theHighCrand == "Mercedes Benz"){
		var theMBModel = new Array("S", "CL", "SL");
		var theHighMBModel = theMBModel[Math.floor(Math.random()*theMBModel.length)]
		document.write("</br>");
		document.write("Model of the Benz is a: " + theHighMBModel);
		}
	if(theHighCrand == "BMW"){
		var theBMWModel = new Array("X5", "X6", "Z4");
		var theHighBMWModel = theBMWModel[Math.floor(Math.random()*theBMWModel.length)]
		document.write("</br>");
		document.write("Model of the Bentley is a: " + theHighBMW6+         Model);
		}	
	document.write("</br>");
	var theHighOrand = theHighOutside[Math.floor(Math.random()*theHighOutside.length)]
	document.write("Exterior: " + theHighOrand);
	document.write("</br>");
	var theHighYrand = theHighYear[Math.floor(Math.random()*theHighYear.length)]
	document.write("Year: " + theHighYrand);
	document.write("</br>");
	var theHighIrand = theHighInside[Math.floor(Math.random()*theHighInside.length)]
	document.write("interior: " + theHighIrand);
	}
	
	
if(money < 180000 && money > 100000){
	var theSecHighCrand = theSecHighCar[Math.floor(Math.random()*theSecHighCar.length)]
	document.write("Car: " + theSecHighCrand);
	if(theSecHighCrand == "Mercedes Benz"){
		var theMBModel = new Array("S", "CL", "SL");
		var theSecHighMBModel = theMBModel[Math.floor(Math.random()*theMBModel.length)]
		document.write("</br>");
		document.write("Model of the Benz is a: " + theSecHighMBModel);
		}
		if(theSecHighCrand == "Camaro"){
		var theCModel = new Array("Coupe", "Convertible", "ZL1")
		var theSecHighCModel = theCModel[Math.floor(Math.random()*theCModel.length)]
		document.write("</br>");
		document.write("Model of the Camaro is a: " + theSecHighCModel);
		}
	document.write("</br>");
	var theSecHighOrand = theSecHighOutside[Math.floor(Math.random()*theSecHighOutside.length)]
	document.write("Exterior: " + theSecHighOrand);
	document.write("</br>");
	var theSecHighYrand = theSecHighYear[Math.floor(Math.random()*theSecHighYear.length)]
	document.write("Year: " + theSecHighYrand);
	document.write("</br>");
	var theSecHighIrand = theSecHighInside[Math.floor(Math.random()*theSecHighInside.length)]
	document.write("interior: " +theSecHighIrand);
	}
	
	
if(money < 100000 && money > 25000){
	var theSecLowCrand = theSecLowCar[Math.floor(Math.random()*theSecLowCar.length)]
	document.write("Car: " + theSecLowCrand);
	
	if(theSecLowCrand == "Camaro"){
		var theCModel = new Array("Coupe", "Convertible", "ZL1")
		var theSecLowCModel = theCModel[Math.floor(Math.random()*theCModel.length)]
		document.write("</br>");
		document.write("Model of the Camaro is a: " + theSecLowCModel);
		}
	if(theSecLowCrand == "Mustang"){
		var theMModel = new Array("V6", "GT", "Boss 302", "Shelby GT500")
		var theSecLowMModel = theMModel[Math.floor(Math.random()*theMModel.length)]
		document.write("</br>");
		document.write("Model of the Mustang is a: " + theSecLowMModel);
		}
	document.write("</br>");
	var theSecLowOrand = theSecLowOutside[Math.floor(Math.random()*theSecLowOutside.length)]
	document.write("Exterior: " + theSecLowOrand);
	document.write("</br>");
	var theSecLowYrand = theSecLowYear[Math.floor(Math.random()*theSecLowYear.length)]
	document.write("Year: " + theSecLowYrand);
	document.write("</br>");
	var theSecLowIrand = theSecLowInside[Math.floor(Math.random()*theSecLowInside.length)]
	document.write("interior: " +theSecLowIrand);
	}
	
	
if(money < 25000 && money > 20000){
	var theLowCrand = theLowCar[Math.floor(Math.random()*theLowCar.length)]
	document.write("Car: " + theLowCrand);
	if(theLowCrand == "Camaro"){
		var theCModel = new Array("Coupe", "Convertible", "ZL1")
		var theLowCModel = theCModel[Math.floor(Math.random()*theCModel.length)]
		document.write("</br>");
		document.write("Model of the Camaro is a: " + theLowCModel);
		}
	if(theLowCrand == "Mustang"){
		var theMModel = new Array("V6", "GT", "Boss 302", "Shelby GT500")
		var theLowMModel = theMModel[Math.floor(Math.random()*theMModel.length)]
		document.write("</br>");
		document.write("Model of the Mustang is a: " + theLowMModel);
		}
	document.write("</br>");
	var theLowOrand = theLowOutside[Math.floor(Math.random()*theLowOutside.length)]
	document.write("Exterior: " + theLowOrand);
	document.write("</br>");
	var theLowYrand = theLowYear[Math.floor(Math.random()*theLowYear.length)]  
	document.write("Year: " + theLowYrand);
	document.write("</br>");
	var theLowIrand = theLowInside[Math.floor(Math.random()*theLowInside.length)]
	document.write("interior: " +theLowIrand);
	}
document.write("</br>");
document.write("with $"+ money);

	
</script>
</Body>
</html>